Add zsh autocompletion to subcommand metadata
authorKnight <Knight42@mail.ustc.edu.cn>
Sun, 5 Jun 2016 10:08:20 +0000 (18:08 +0800)
committerKnight <Knight42@mail.ustc.edu.cn>
Sun, 5 Jun 2016 10:09:25 +0000 (18:09 +0800)
src/etc/_cargo

index c2d9770d771efa1da92e2f17423b52b2f36f6c24..529aa89f745c5eed40c66d492ea2fbf52fd79149 100644 (file)
@@ -16,7 +16,6 @@ _arguments \
 
 case $state in
     args)
-        #TODO: add path completion to manifest-path options
         case $words[1] in
             bench)
                 _arguments \
@@ -160,6 +159,19 @@ case $state in
                     '--color=:colorization option:(auto always never)' \
                     ;;
 
+            metadata)
+                _arguments \
+                    '(-h, --help)'{-h,--help}'[show help message]' \
+                    '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+                    '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+                    "--no-deps[output information only about the root package and don't fetch dependencies]" \
+                    '--no-default-features[do not include the default feature]' \
+                    '--manifest-path=[path to manifest]: :_files -/' \
+                    '--features=[space separated feature list]' \
+                    '--format-version=[format version(default: 1)]' \
+                    '--color=:colorization option:(auto always never)' \
+                    ;;
+
             new)
                 _arguments \
                     '--bin[use binary template]' \
@@ -373,6 +385,7 @@ local -a commands;commands=(
 'install:install a Rust binary'
 'locate-project:print "Cargo.toml" location'
 'login:login to remote server'
+'metadata:the metadata for a project in json'
 'new:create a new project'
 'owner:manage the owners of a crate on the registry'
 'package:assemble local package into a distributable tarball'